<!DOCTYPE html>
<html>
	<head th:replace="/mobile/common::head(~{::custom_settings})">
		<th:block th:fragment="custom_settings">
			<title>顺山科技智慧生活服务平台</title>
			<link type="text/css" rel="stylesheet" th:href="@{{css}/mobile/member/mobilepersonal/mobileOrderManagement.css(css=${css})}"/>
			<script th:inline="javascript">
		    	var tabindex = [[${tabindex}]];
			</script>
		</th:block>
	</head>
	<body>
		<div class="weui-tab">
			<div class="weui-tab-title-order"><i class="fa fa-angle-left" onclick="back()"></i><h1>我的订单</h1></div>
			<div class="weui-tab-main-order">
				  <div class="weui-navbar slide-box">
					    <div class="slide-item"><a class="weui-navbar__item" data="1">全部</a></div>
				        <div class="slide-item"><a class="weui-navbar__item" data="2">待付款<span class="weui-tab-buylist-tp3" th:if="${waitpaynum} gt 0" th:text="${waitpaynum}"></span></a></div>
				        <div class="slide-item"><a class="weui-navbar__item" data="3">待发货</a></div>
				        <div class="slide-item"><a class="weui-navbar__item" data="4">待收货<span class="weui-tab-buylist-tp3" th:if="${waittakenum} gt 0" th:text="${waittakenum}"></span></a></div>
				        <div class="slide-item"><a class="weui-navbar__item" data="5">已完成</a></div>
				        <div class="slide-item"><a class="weui-navbar__item" data="6">已取消</a></div>
				  </div>
				  <div class="weui-tab__bd">
					<div class="weui-tab__bd-item weui-tab__bd-item--active" id="orderlist">
						<th:block th:fragment="order_refresh">
							<th:block th:each="order : ${result}">
						    	<div class="weui-tab-buylist">
						     		<div class="weui-tab-buylist-gtime">
							     		<div class="weui-tab-buylist-gtime1"><h1><img th:src="@{{image}/mobile/member/pay-pic.png(image=${image})}"/><th:block th:text="${order.merchantname}"></th:block></h1></div>
							     		<div class="weui-tab-buylist-gtime2">
							     			<span th:if="${order.orderstate} eq '2'" >待付款</span>
							     			<span th:if="${order.orderstate} eq '3'" >待发货</span>
							     			<span th:if="${order.orderstate} eq '4'" >待收货</span>
							     			<span th:if="${order.orderstate} eq '5'" >已完成</span>
							     			<span th:if="${order.orderstate} eq '6'" >已取消</span>
						     			</div>
						    		</div>
						    		<div class="slide-boxs" th:data-orderid="${order.orderid}" th:data-state="${order.orderstate}" onclick="goinfo(this.getAttribute('data-orderid'),this.getAttribute('data-state'))">
						    			<div class="slide-items" th:each="img : ${order.piclist}"><img th:src="${img}"/></div>
						    		</div>
						    		<div class="weui-tab-buylist-goodsm">
						    			<i class="weui-tab-buylist-gm3" th:text="'共'+${order.ordernum}+'件'"></i>
						    			<i>合计：<i class="weui-tab-buylist-gm4" th:text="'￥'+${order.ordermoney}"></i></i>
						    		</div>
						    		<div class="weui-tab-buylist-btn" th:if="${order.orderstate} eq '2'">
						    			<a class="weui-tab-buylist-btn1" th:data-orderid="${order.orderid}" th:data-paymodel="${order.paymodel}" th:data-orderorigin="${order.orderorigin}" onclick="gopay(this.getAttribute('data-orderid'),this.getAttribute('data-paymodel'),this.getAttribute('data-orderorigin'))">去付款</a>
						    			<a class="weui-tab-buylist-btn2" th:data-orderid="${order.orderid}" onclick="cancleorder(this.getAttribute('data-orderid'))">取消订单</a>
						    		</div>
						    		<div class="weui-tab-buylist-btn" th:if="${order.orderstate} eq '3'">
						    			<th:block th:if="${order.isnorefundtype} eq 0">
							    			<a class="weui-tab-buylist-btn2" th:data-orderid="${order.orderid}" onclick="refundmoney(this.getAttribute('data-orderid'))">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.isnorefundtype} eq 1">
							    			<span style="color:#a6a6a6; line-height:30px;">该订单已超过退款期限</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.isnorefundtype} eq 2">
						    				<span style="color:#a6a6a6;line-height:30px;">该订单不支持退款</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.isnorefundtype} eq 3">
						    				<span style="color:#a6a6a6; line-height:30px;">该订单已申请退款</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    		</div>
						    		<div class="weui-tab-buylist-btn" th:if="${order.orderstate} eq '4'">
						    			<th:block th:if="${order.isnorefundtype} eq 0">
							    			<a class="weui-tab-buylist-btn2" th:data-orderid="${order.orderid}" onclick="refundmoney(this.getAttribute('data-orderid'))">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.isnorefundtype} eq 1">
							    			<span style="color:#a6a6a6; line-height:30px;">该订单已超过退款期限</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.isnorefundtype} eq 2">
						    				<span style="color:#a6a6a6;line-height:30px;">该订单不支持退款</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.isnorefundtype} eq 3">
						    				<span style="color:#a6a6a6; line-height:30px;">该订单已申请退款</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    			<a class="weui-tab-buylist-btn1" th:data-orderid="${order.orderid}" onclick="finishorder(this.getAttribute('data-orderid'))">确认收货</a>
						    		</div>
						    		<div class="weui-tab-buylist-btn" th:if="${order.orderstate} eq '5'">
						    			<th:block th:if="${order.orderorigin} eq 1">
							    			<span style="color:#a6a6a6; line-height:30px;">线下订单无法退款</span>
							    			<a class="weui-tab-buylist-btn4">申请退款</a>
						    			</th:block>
						    			<th:block th:if="${order.orderorigin} eq 2">
							    			<th:block th:if="${order.isnorefundtype} eq 0">
								    			<a class="weui-tab-buylist-btn2" th:data-orderid="${order.orderid}" onclick="refundmoney(this.getAttribute('data-orderid'))">申请退款</a>
							    			</th:block>
							    			<th:block th:if="${order.isnorefundtype} eq 1">
								    			<span style="color:#a6a6a6; line-height:30px;">该订单已超过退款期限</span>
								    			<a class="weui-tab-buylist-btn4">申请退款</a>
							    			</th:block>
							    			<th:block th:if="${order.isnorefundtype} eq 2">
							    				<span style="color:#a6a6a6;line-height:30px;">该订单不支持退款</span>
								    			<a class="weui-tab-buylist-btn4">申请退款</a>
							    			</th:block>
							    			<th:block th:if="${order.isnorefundtype} eq 3">
							    				<span style="color:#a6a6a6; line-height:30px;">该订单已申请退款</span>
								    			<a class="weui-tab-buylist-btn4">申请退款</a>
							    			</th:block>
						    			</th:block>
						    			<a class="weui-tab-buylist-btn1" th:data-orderid="${order.orderid}" onclick="payagainorder(this.getAttribute('data-orderid'))">再次购买</a>
						    			<a class="weui-tab-buylist-btn2" th:data-orderid="${order.orderid}" onclick="deleteorder(this.getAttribute('data-orderid'))">删除订单</a>
						    			<!-- 
						    			<a class="weui-tab-buylist-btn2">评价</a>
						    			 -->
						    		</div>
						    		<div class="weui-tab-buylist-btn" th:if="${order.orderstate} eq '6'">
						     			<a class="weui-tab-buylist-btn1" th:data-orderid="${order.orderid}" onclick="payagainorder(this.getAttribute('data-orderid'))">再次购买</a>
						    			<a class="weui-tab-buylist-btn2" th:data-orderid="${order.orderid}" onclick="deleteorder(this.getAttribute('data-orderid'))">删除订单</a>
						    			<!-- 
						    			<a class="weui-tab-buylist-btn2">退款明细</a>
						    			 -->
						    		</div>
						    	</div>
							</th:block>
						</th:block>
					</div>
				  </div>
				</div>
			</div>
			<!-- 退款弹框 -->
			<div th:replace="/mobile/member/mobilepersonal/moblieRefundWindow :: RefundWindow"></div>
			<!--退款弹框-->
			
	<script type="text/javascript" th:src="@{{js}/mobile/member/mobilepersonal/mobileOrderManagement.js(js=${js})}"></script>
	</body>
</html>